﻿/// <reference name="MicrosoftAjax.js"/>


$(document).ready(function() {
    $("#loginForm").validate({
        rules: {
            uEmail: {
                required: true,
                email: true
            },
            uPassword: {
                required: true,
                rangelength: [6, 30]
            }
        },
        messages: {
            uEmail: {
                required: lang('ls_input_myb'),
                email: lang('ls_myb_email')
            },
            uPassword: {
                required: lang('ls_login_password'),
                rangelength: $.format(lang('ls_password_length'))
            }
        },
        errorPlacement: function(error, element) {
            var placement = $(element.parent("td").parent("tr").next("tr").find("td").get(1));
            placement.text('');
            error.appendTo(placement);
        },
        onkeyup: false
    });
    var accountTipsText = lang('ls_account_email');
    $("#uEmail").focus(function() {
        if (!$($(this).parent().parent().next().find('td').get(1)).text()) {
            $($(this).parent().parent().next().find('td').get(1)).html('<span class="font_888_8">' + accountTipsText + '</span>');
        }
        $(this).css('color', '#000');
    }).focus();
}); 


